home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
- MODIFY(QUEL) 2/23/79 MODIFY(QUEL)
-
-
-
- NAME
- modify - convert the storage structure of a relation
-
- SYNOPSIS
- _m_o_d_i_f_y relname _t_o storage-structure [ _o_n key1 [ : _s_o_r_t_o_r_d_e_r
- ] [ { , key2 [ : _s_o_r_t_o_r_d_e_r ] } ] ] [ _w_h_e_r_e [ _f_i_l_l_f_a_c_t_o_r
- = _n ] [ , _m_i_n_p_a_g_e_s = _n ] [ , _m_a_x_p_a_g_e_s = _n ] [ , _l_i_d_n =
- _l_i_d_n_a_m_e ] [
-
- DESCRIPTION
- _R_e_l_n_a_m_e is modified to the specified storage structure.
- Only the owner of a relation can modify that relation. This
- command is used to increase performance when using large or
- frequently referenced relations. The storage structures are
- specified as follows:
-
- isam - indexed sequential storage structure
- cisam - compressed isam
- hash - random hah storage structure
- chash - compressed hash
- heap - unkeyed and unstructured
- cheap - compressed heap
- heapsort - heap with tuples sorted and duplicates re-
- moved
- cheapsort - compressed heapsort
- truncated - heap with all tuples deleted
- orderedn - ordered relation where n is the ordering di-
- mension
-
- The paper ``Creating and Maintaining a Database in INGRES''
- (ERL Memo M77-71) discusses how to select storage structures
- based on how the relation is used.
-
- The current compression algorithm only suppresses trailing
- blanks in character fields. A more effective compression
- scheme may be possible, but tradeoffs between that and a
- larger and slower compression algorithm are not clear.
-
- If the _o_n phrase is omitted when modifying to isam, cisam,
- hash or chash, the relation will automatically be keyed on
- the first domain. When modifying to heap or cheap the _o_n
- phrase must be omitted. When modifying to heapsort or
- cheapsort the _o_n phrase is optional.
-
- When a relation is being sorted (isam, cisam, heapsort and
- cheapsort), the primary sort keys will be those specified in
- the _o_n phrase (if any). The first key after the _o_n phrase
- will be the most significant sort key and each successive
- key specified will be the next most significant sort key.
- Any domains not specified in the _o_n phrase will be used as
- least significant sort keys in domain number sequence.
-
- When a relation is modified to heapsort or cheapsort, the
- _s_o_r_t_o_r_d_e_r can be specified to be _a_s_c_e_n_d_i_n_g or _d_e_s_c_e_n_d_i_n_g.
- The default is always _a_s_c_e_n_d_i_n_g. Each key given in the _o_n
- phrase can be optionally modified to be:
-
- key:descending
-
- which will cause that key to be sorted in descending order.
- For completeness, _a_s_c_e_n_d_i_n_g can be specified after the colon
- (`:'), although this is unnecessary since it is the default.
- _D_e_s_c_e_n_d_i_n_g can be abbreviated by a single `_d' and,
- correspondingly, _a_s_c_e_n_d_i_n_g can be abreviated by a single
- `_a'.
-
- When modifying to _o_r_d_e_r_e_d_n, up to n ordering keys can be
- specified using the _o_n clause. Ordering keys are used to
- specify the ordering of tuples in the new relation. Changes
- on key field values indicate the incrementing of a lid value
- for the lid corresponding to the key change. If no ordering
- keys are specified, only the lid corresponding to the lowest
- lid level is incremented by one for every new tuple. In
- this case,the order of the tuples is determined by their
- sort order on file. However, note that ordering does not
- destroy any current storage structures on a relation (except
- secondary indices).
-
- _L_i_d_n can only be specified if modifying to _o_r_d_e_r_e_d_n. De-
- fault values are _l_i_d_1 , _l_i_d_2 , and _l_i_d_3.
-
- _F_i_l_l_f_a_c_t_o_r specifies the percentage (from 1 to 100) of each
- primary data page that should be filled with tuples, under
- ideal conditions. _F_i_l_l_f_a_c_t_o_r may be used with isam, cisam,
- hash and chash. Care should be taken when using large
- fillfactors since a non-uniform distribution of key values
- could cause overflow pages to be created, and thus degrade
- access performance for the relation.
-
- _M_i_n_p_a_g_e_s specifies the minimum number of primary pages a
- hash or chash relation must have. _M_a_x_p_a_g_e_s specifies the
- maximum number of primary pages a hash or chash relation may
- have. _M_i_n_p_a_g_e_s and _m_a_x_p_a_g_e_s must be at least one. If both
- _m_i_n_p_a_g_e_s and _m_a_x_p_a_g_e_s are specified in a modify, _m_i_n_p_a_g_e_s
- cannot exceed _m_a_x_p_a_g_e_s.
-
- Default values for _f_i_l_l_f_a_c_t_o_r, _m_i_n_p_a_g_e_s, and _m_a_x_p_a_g_e_s are as
- follows:
-
- _F_I_L_L_F_A_C_T_O_R _M_I_N_P_A_G_E_S _M_A_X_P_A_G_E_S
-
- hash 50 10 no limit
- chash 75 1 no limit
- isam 80 NA NA
- cisam 100 NA NA
-
- EXAMPLES
- /* modify the emp relation to an indexed
- sequential storage structure with
- "name" as the keyed domain */
-
- modify emp to isam on name
-
- /* if "name" is the first domain of the emp relation,
- the same result can be achieved by */
-
- modify emp to isam
-
- /* do the same modify but request a 60% occupancy
- on all primary pages */
-
- modify emp to isam on name where fillfactor = 60
-
- /* modify the supply relation to compressed hash
- storage structure with "num" and "quan"
- as keyed domains */
-
- modify supply to chash on num, quan
-
- /* now the same modify but also request 75% occupancy
- on all primary, a minimum of 7 primary pages
- pages and a maximum of 43 primary pages */
-
- modify supply to chash on num, quan
- where fillfactor = 75, minpages = 7,
- maxpages = 43
-
- /* again the same modify but only request a minimum
- of 16 primary pages */
-
- modify supply to chash on num, quan
- where minpages = 16
-
- /* modify parts to a heap storage structure */
-
- modify parts to heap
-
- /* modify parts to a heap again, but have tuples
- sorted on "pnum" domain and have any duplicate
- tuples removed */
-
- modify parts to heapsort on pnum
-
- /* modify employee in ascending order by manager,
- descending order by salary and have any
- duplicate tuples removed */
-
- modify employee to heapsort on manager, salary:descending
-
- /* ordered relation */
-
- modify text to ordered1 on lid where lid1 = lidfield
-
- SEE ALSO
- sysmod(unix) ordered(quel)
-
-
-